package com.hospital.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Date;

@Data
public class Prescription {
    @NotNull(message = "id不得为空")
    private int prescription_id;

    @NotNull(message = "patient_id不得为空")
    private int patient_id;

    @NotNull(message = "employee_id不得为空")
    private int employee_id;

    @NotNull(message = "office_id不得为空")
    private int office_id;

    private int drug_id;//可以没有药品

    private int check_id;//可以没有检查单

    @NotEmpty(message = "处方内容不得为空")
    private String prescription_content;

    @NotNull(message = "处方价格不得为空")//处方价格为检查，药品，注射费之和
    private double prescription_price;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "处方日期不得为空")
    private Date prescription_time;
}
